From: Mukesh Rathor Date: Wed, 13 Nov 2013 08:39:13 +0000 (+0100) Subject: pvh: PV cpuid X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~5964 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=bcb18d14468446f2bcc06ed1264bed38ad7ac0c1;p=xen.git pvh: PV cpuid NB at the moment we do not handle forced emulated ops. This means, for example, that xen-detect will report an HVM Xen guest instead of a PV one. Signed-off-by: Mukesh Rathor Signed-off-by: George Dunlap Reviewed-by: Jan Beulich Acked-by: Keir Fraser Acked-by: Eddie Dong --- diff --git a/xen/arch/x86/hvm/vmx/vmx.c b/xen/arch/x86/hvm/vmx/vmx.c index 854f588046..1c91e098af 100644 --- a/xen/arch/x86/hvm/vmx/vmx.c +++ b/xen/arch/x86/hvm/vmx/vmx.c @@ -2766,8 +2766,8 @@ void vmx_vmexit_handler(struct cpu_user_regs *regs) break; } case EXIT_REASON_CPUID: + is_pvh_vcpu(v) ? pv_cpuid(regs) : vmx_do_cpuid(regs); update_guest_eip(); /* Safe: CPUID */ - vmx_do_cpuid(regs); break; case EXIT_REASON_HLT: update_guest_eip(); /* Safe: HLT */ diff --git a/xen/arch/x86/traps.c b/xen/arch/x86/traps.c index 26ae7229df..4b2c2ea8f4 100644 --- a/xen/arch/x86/traps.c +++ b/xen/arch/x86/traps.c @@ -719,7 +719,7 @@ int cpuid_hypervisor_leaves( uint32_t idx, uint32_t sub_idx, return 1; } -static void pv_cpuid(struct cpu_user_regs *regs) +void pv_cpuid(struct cpu_user_regs *regs) { uint32_t a, b, c, d; diff --git a/xen/include/asm-x86/processor.h b/xen/include/asm-x86/processor.h index 893afa3a84..551036db81 100644 --- a/xen/include/asm-x86/processor.h +++ b/xen/include/asm-x86/processor.h @@ -567,6 +567,8 @@ void microcode_set_module(unsigned int); int microcode_update(XEN_GUEST_HANDLE_PARAM(const_void), unsigned long len); int microcode_resume_cpu(int cpu); +void pv_cpuid(struct cpu_user_regs *regs); + #endif /* !__ASSEMBLY__ */ #endif /* __ASM_X86_PROCESSOR_H */